
#ifndef __TOOL_H__
#define __TOOL_H__

#include <vector>
#include <iostream>
#include <fstream>
#include <memory>
#include <cstring>
#include <numeric>
#include <chrono>
#include <algorithm>

#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>


struct  Detection {
        //左上角和右下角
        float bbox[4];
        float conf;  // bbox_conf * cls_conf
        float class_id;
};
    
bool cmp(Detection& a, Detection& b);
float iou(Detection a, Detection  b);
std::vector<float>  letterbox(cv::Mat &src, int h, int w, std::vector<float> &pad);
std::vector< Detection >nms(float *out_pred, std::vector<float>pad,float nms_thresh,float score_thresh);

#endif





